<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<title>Transition To A Dynamic View</title>
		<link href="../themes/iphone/iphone.css" rel="stylesheet"></link>
		<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="parseOnLoad: true"></script>

		<script language="JavaScript" type="text/javascript">
			//dojo.require("dojo.parser"); // Use the lightweight parser.
			dojo.require("dojox.mobile.parser");
			dojo.require("dojox.mobile");
			dojo.requireIf(!dojo.isWebKit, "dojox.mobile.compat");

			dojo.declare(
				"dojox.mobile.ListItemEx",
				dojox.mobile.ListItem,
			{
				_parse: function(text){
					var obj = dojo.fromJson(text);
					if(!obj.items){ return; }
					var items = obj.items;

					var container = dojo.create("div", {}, dojo.body());
					var view1 = new dojox.mobile.View({selected:true}, container);
					view1.startup();

					var heading1 = new dojox.mobile.Heading({
						label: "New Dynamic View",
						back: "Home",
						moveTo: "home"
					});
					view1.addChild(heading1);
					heading1.startup();

					var categ1 = new dojox.mobile.RoundRectCategory({
						label: "Documents"
					});
					view1.addChild(categ1);

					var list1 = new dojox.mobile.RoundRectList();
					view1.addChild(list1);

					for(var i = 0; i < items.length; i++){
						var item1 = new dojox.mobile.ListItem({
							icon: "images/i-icon-"+(i+1)+".png",
							label: items[i].title,
							href: items[i].href
						});
						list1.addChild(item1);
					}
					var id = view1.id;
					return dojo.hash ? "#" + id : id;
				}
			});
		</script>
	</head>
	<body>
		<div id="home" dojoType="dojox.mobile.View" selected="true">
			<h1 dojoType="dojox.mobile.Heading">Animations</h1>
			<h2 dojoType="dojox.mobile.RoundRectCategory">Transition Effects</h2>
			<ul dojoType="dojox.mobile.RoundRectList">
				<li dojoType="dojox.mobile.ListItemEx" icon="images/i-icon-1.png" url="items.json" transition="slide">
					Slide
				</li>
				<li dojoType="dojox.mobile.ListItemEx" icon="images/i-icon-2.png" url="items.json" transition="flip">
					Flip
				</li>
				<li dojoType="dojox.mobile.ListItemEx" icon="images/i-icon-3.png" url="items.json" transition="fade">
					Fade
				</li>
			</ul>
		</div>
	</body>
</html>
